import { ResponseData } from '@/api/type'

export interface CodeData extends ResponseData {
    data: string
}

//手机号登录接口需要携带参数类型
export interface LoginParams {
    code: string,
    phone: string
}

// 手机号登录接口返回用户信息数据
export interface UserInfoData {
    name: string,
    token: string
}

export interface UserLoginResponseData extends ResponseData {
    data: UserInfoData
}

// 定义微信扫码登录返回的数据的ts类型
export interface WXLoginData {
    "redirectUri": string,
    "appid": string,
    "scope": string,
    "state": string
}

export interface WXLoginResponseData extends ResponseData {
    data: WXLoginData
}
// 登陆用户信息
export interface UserInfo {
    "id": number,
    "createTime": string,
    "updateTime": string,
    "isDeleted": number,
    "param": {
    },
    "openid": null,
    "nickName": null,
    "phone": string,
    "name": string,
    "certificatesType": string,
    "certificatesNo": string,
    "certificatesUrl": null,
    "authStatus": number,
    "status": number
}

export interface UserInfoResponseData extends ResponseData {
    data: UserInfo
}
// 实名认证
export interface AuthParams {
    "certificatesNo": string,
    "certificatesType": string,
    "certificatesUrl": string,
    "name": string
}

// 就诊人相关
// 就诊人返回数据
export interface visitorType {
    "id": number,
    "createTime": string,
    "updateTime": string,
    "isDeleted": number,
    "param": {
        "certificatesTypeString": string,
        "contactsCertificatesTypeString": string,
        "cityString": null,
        "fullAddress": string,
        "districtString": null,
        "provinceString": null
    },
    "userId": number,
    "name": string,
    "certificatesType": string,
    "certificatesNo": string,
    "sex": number,
    "birthdate": string,
    "phone": string,
    "isMarry": number,
    "provinceCode": null,
    "cityCode": null,
    "districtCode": null,
    "address": string,
    "contactsName": string,
    "contactsCertificatesType": string,
    "contactsCertificatesNo": string,
    "contactsPhone": string,
    "isInsure": number,
    "cardNo": null,
    "status": string
}

export type visitorArr = visitorType[]
export interface VisitorResponseData extends ResponseData {
    data: visitorArr
}

export interface submitOrderParams {
    // 医院编号
    hoscode: string,
    //排班id
    scheduleId: string,
    // 就诊人id
    patientId: number
}

export interface submitOrderResponseData extends ResponseData {
    data: number
}

// 订单详情
export interface OrderInfoData {
    "id": number,
    "createTime": string,
    "updateTime": string,
    "isDeleted": number,
    "param": {
        "orderStatusString": string
    },
    "userId": number,
    "outTradeNo": string,
    "hoscode": string,
    "hosname": string,
    "depcode": string,
    "depname": string,
    "scheduleId": string,
    "title": string,
    "reserveDate": string,
    "reserveTime": number,
    "patientId": number,
    "patientName": string,
    "patientPhone": string,
    "hosRecordId": string,
    "number": number,
    "fetchTime": string,
    "fetchAddress": string,
    "amount": number,
    "quitTime": string,
    "orderStatus": number
}

export interface OrderInfoResponseData extends ResponseData {
    data: OrderInfoData
}

// 下单生成支付二维码

export interface QrCodeData {
    "codeUrl": string,
    "orderId": number,
    "totalFee": number,
    "resultCode": string
}

export interface QrCodeResponseData extends ResponseData {
    data: QrCodeData
}

// 查询订单支付状态
export interface PayStatusResponseData extends ResponseData {
    data: boolean
}

// 订单列表
export interface OrderParams {
    userId?: number,
    outTradeNo?: string,
    patientId?: string,
    patientName?: string,
    keyword?: string,
    orderStatus?: string,
    reserveDate?: string,
    createTimeBegin?: string,
    createTimeEnd?: string,
}
export interface OrderListResponseData extends ResponseData {
    data: {
        records: OrderInfoData[],
        "total": number,
        "size": number,
        "current": number,
        "orders": [],
        "hitCount": boolean,
        "searchCount": boolean,
        "pages": number
    }
}

// 订单状态
export interface orderStatus {
    "comment": string,
    "status": number
}

export type orderStatusData = orderStatus[]
export interface OrderStatusResponseData extends ResponseData {
    data: orderStatusData
}

export interface patientParams {
    id?: string,
    name: string,
    certificatesType: string,
    certificatesNo: string,
    sex: number,
    birthdate: string,
    phone: string,
    isMarry: number,
    isInsure: number,
    addressSelected: string[],
    address: string,
    contactsName: string,
    contactsCertificatesType: string
    contactsCertificatesNo: string
    contactsPhone: string
}

export interface patientResponseData extends ResponseData {
    data: visitorType
}